<template>
  <div id="pay">


    <el-form :inline="true" :model="aliPay">
      <el-form-item label="保证金">
        <el-input v-model="aliPay.orderPrice" placeholder="请输入保证金额"></el-input>
      </el-form-item>
      <el-form-item label="订单号">
        <el-input v-model="aliPay.id" placeholder="请输入订单号"></el-input>
      </el-form-item>
      <el-form-item label="订单名">
        <el-input v-model="aliPay.auctionId" placeholder="请输入订单号"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="paySecurity">缴纳保证金</el-button>
      </el-form-item>

    </el-form>



  </div>
</template>

<script>
  export default {
    name: 'ALiPay',
    data() {
      return {
        aliPay:{
          id:'',
          orderPrice:'',
          auctionId:''
        }

      }
    },
    methods: {
      paySecurity() {
        this.axios.post("http://127.0.0.1:8090/payment/pay",this.aliPay)
          .then(res => {
            const div = document.createElement('div')
            div.innerHTML = res // data就是接口返回的form 表单字符串
            console.log(div)
            document.body.appendChild(div)
            document.forms[1].setAttribute('target', '_blank')
            document.forms[1].submit()
          })
      }
    },

  }
</script>

<style>
</style>
